<%@ page import="java.net.URLDecoder" %><%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2017/7/19
  Time: 16:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
    <title>果蔬商城-水果网购首选品牌,只为一份极致的新鲜!</title>
    <link href="${path}/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="${path}/css/register-login/common.css" rel="stylesheet" type="text/css">
    <link href="${path}/css/register-login/style.css" rel="stylesheet" type="text/css">
    <link href="${path}/css/register-login/login.css" rel="stylesheet" type="text/css">

</head>

<body>
<!--引入导航begin-->
<%@ include file="../common/header.jsp" %>
<!--引入导航end-->
<!-- 提供一个jsp代码块 -->
<%
    String uname = "";
    String pwd = "";
    Cookie[] cookies = request.getCookies();

    if (null != cookies && cookies.length > 0) {
        for (Cookie c : cookies) {
            if ("username".equals(c.getName())) {
                //获取该cookie的value
                String urr = c.getValue();
                //根据:进行切割
                String[] values = urr.split("\\:");
                //同样需要对用户名进行一级解码
                uname = URLDecoder.decode(values[0], "utf-8");
                pwd = values[1];

            }
        }
    }
    request.setAttribute("uname", uname);
    request.setAttribute("pwd", pwd);
%>
<!--登录开始-->
<div class="w-1000 w-750 pt-50">
    <p class="member">会员登录</p>
    <div class="login-sec clearfix">
        <div class="login-left pull-left">
            <img src="${path}/images/logo-2.png" height="70%" width="85%">
        </div>

        <div class="login-right pull-right">
            <div class="login-form">
                <form   action="${path}/user/logincl" method="post" class="form-horizontal" role="form">
                    <ul>
                        <li class="clearfix">
                            <div class="text02 all pull-left">
                                <span class="user">用户名</span>
                            </div>
                            <div class="send-yanzm pull-left">
                                <input type="text" class="form-control" id="username" name="username" value="${uname}"
                                       placeholder="小写字母开头,不含中文.">
                                <span class="true"></span>
                            </div>
                            <%--  <c:if test="${error==0}">--%>
                            <div class="com-md-2 ">
                                <label class="alert-danger">${maps["userError"]}</label>
                            </div>
                            <%--  </c:if>--%>
                        </li>

                        <li class="clearfix">
                            <div class="text04 all pull-left">
                                <span class="code">密码</span>
                            </div>
                            <div class="password pull-left">
                                <input type="password" name="password" value="${pwd}" placeholder="密码长度6-12位"
                                       minlength="6" maxlength="12" class="form-control" id="password">
                                <span class="true"></span>
                            </div>
                            <div class="com-md-2 ">
                                <label class="alert-danger">${list["passwordError"]}</label>
                            </div>
                        </li>

                        <li class="clearfix log-wj">
                            <div class="wj-mima clearfix pull-right">
                                <div class="fr-ch pull-left">
                                    <div class="checkbox">
                                        <label for="blankCheckbox">
                                            <input type="checkbox" id="blankCheckbox" value="option1" name="flag">
                                            <span>记住密码</span>
                                        </label>
                                    </div>
                                </div>
                            </div>
                        </li>

                        <li class="clearfix">
                            <div class="fruit-login pull-right">
                                <div class="fr-regist pull-left">
                                    <input type="submit" class=" btn btn-success " value="登录" style="width: 120px">
                                </div>
                                <div class="fr-login pull-left">
                                    <input type="button" class=" btn btn-success " value="会员注册" onclick="register()"
                                           style="width: 120px">
                                </div>
                            </div>
                        </li>
                    </ul>
                </form>
            </div>
        </div>
    </div>
</div>
<!--引入footer Begin-->
<%@ include file="../common/footer.jsp" %>
<!--引入footer  End-->
<!--冲突-->
<%--<script src="${path}/dist/js/jquery.min.js"></script>--%>
<script src="${path}/dist/js/bootstrap.min.js"></script>
<script src="${path}/js/register-login/wow.js"></script>
<script>
    function register() {
        window.location = "${path}/user/registerView";
    }
</script>
</body>
</html>